package com.lyh.common.enums;

/**
 * 充值状态
 *
 * @author lyh
 */
public enum RechargeStatusEnum
{

    WAIT(0, "待支付"),
    SUCCESS(1, "充值成功"),
    FAIL(2, "充值失败"),
    ;

    private  Integer code;
    private  String info;

    RechargeStatusEnum(Integer code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public static RechargeStatusEnum getEnum(Integer code) {
        for (RechargeStatusEnum el : RechargeStatusEnum.values()) {
            if (el.getCode()==code) {
                return el;
            }
        }

        return null;
    }

}
